﻿using System.Web.Mvc;

namespace UcAsp.Net.Comm
{
    public class ViewEngine : RazorViewEngine
    {
        internal static string ViewStartFileName = "_ViewStart";
        
        public ViewEngine()
            : this(null, "default")
        {
            


        }
        public ViewEngine(IViewPageActivator viewPageActivator, string themes)
            : base(viewPageActivator)
        {
            AreaViewLocationFormats = new[] {
                "~/themes/"+themes+"/{2}/{1}/{0}.cshtml",
                "~/themes/"+themes+"/{2}/{1}/{0}.vbhtml",
                "~/themes/"+themes+"/{2}/Shared/{0}.cshtml",
                "~/themes/"+themes+"/{2}/Shared/{0}.vbhtml"
            };
            AreaMasterLocationFormats = new[] {
                "~/themes/"+themes+"/{2}/{1}/{0}.cshtml",
                "~/themes/"+themes+"/{2}/{1}/{0}.vbhtml",
                "~/themes/"+themes+"/{2}/Shared/{0}.cshtml",
                "~/themes/"+themes+"/{2}/Shared/{0}.vbhtml"
            };
            AreaPartialViewLocationFormats = new[] {
                "~/themes/"+themes+"/{2}/{1}/{0}.cshtml",
                "~/themes/"+themes+"/{2}/{1}/{0}.vbhtml",
                "~/themes/"+themes+"/{2}/Shared/{0}.cshtml",
                "~/themes/"+themes+"/{2}/Shared/{0}.vbhtml"
            };

            ViewLocationFormats = new[] {
                "~/themes/"+themes+"/{1}/{0}.cshtml",
                "~/themes/"+themes+"/{1}/{0}.vbhtml",
                "~/themes/"+themes+"/Shared/{0}.cshtml",
                "~/themes/"+themes+"/Shared/{0}.vbhtml"
            };
            MasterLocationFormats = new[] {
                "~/themes/"+themes+"/{1}/{0}.cshtml",
                "~/themes/"+themes+"/{1}/{0}.vbhtml",
                "~/themes/"+themes+"/Shared/{0}.cshtml",
                "~/themes/"+themes+"/Shared/{0}.vbhtml"
            };
            PartialViewLocationFormats = new[] {
                "~/themes/"+themes+"/{1}/{0}.cshtml",
                "~/themes/"+themes+"/{1}/{0}.vbhtml",
                "~/themes/"+themes+"/Shared/{0}.cshtml",
                "~/themes/"+themes+"/Shared/{0}.vbhtml"
            };

            FileExtensions = new[] {
                "cshtml",
                "vbhtml",
            };
        }
    }
}